{template "mheader.html"}

<form action="" class="form-horizontal" method="post" name="myform" id="myform">
    {dr_form_hidden()}
    <div class="portlet light ">
        <div class="portlet-title">
            <div class="caption fc-mall-order-title">
                {$item.title}
            </div>
        </div>
        <div class="portlet-body form" style="padding-top: 20px!important">
            <div class="row">
                <div class="col-md-6">
                    <div class="form-group row">
                        <label class="col-md-3 control-label">{dr_lang('订单编号')}</label>
                        <div class="col-md-7">
                            <p class="form-control-static"><a target="_blank" href="{dr_member_url("order/home/show", ["id"=>$order.id])}">{$order.sn}</a></p>
                        </div>
                    </div>

                </div>
                <div class="col-md-6">
                    <div class="form-group row">
                        <label class="col-md-3 control-label">{dr_lang('申请时间')}</label>
                        <div class="col-md-7">
                            <p class="form-control-static">{dr_date($item.inputtime, 'Y-m-d H:i:s', 'red')}</p>
                        </div>
                    </div>
                </div>
                <!--/span-->
                <!--/span-->
            </div>
            <!--/row-->
            <!--/row-->
            <div class="row">
                <div class="col-md-6">
                    <div class="form-group row">
                        <label class="col-md-3 control-label">{dr_lang('申请类型')}</label>
                        <div class="col-md-7">
                            <p class="form-control-static" style="cursor: pointer" >{order_service_type($item.type)}</p>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group row">
                        <label class="col-md-3 control-label">{dr_lang('退款金额')}</label>
                        <div class="col-md-7">
                            <p class="form-control-static" >¥{$item.money}元</p>
                        </div>
                    </div>
                </div>
                <!--/span-->
            </div>
            <!--/row-->
            <div class="row">
                <div class="col-md-6">
                    <div class="form-group row">
                        <label class="col-md-3 control-label">{dr_lang('申请说明')}</label>
                        <div class="col-md-7">
                            <p class="form-control-static" style="cursor: pointer" >{nl2br($item.remark)}</p>
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group row">
                        <label class="col-md-3 control-label">{dr_lang('申请状态')}</label>
                        <div class="col-md-7">
                            <p class="form-control-static" >{order_service_status($item.status)}</p>
                        </div>
                    </div>
                </div>
                <!--/span-->
            </div>
            <div class="row">
                <div class="col-md-6">
                    <div class="form-group row">
                        <label class="col-md-3 control-label"></label>
                        <div class="col-md-9">
                        <div class="row">
                        {loop $item.images.file $i $t}
                        <div class="col-sm-6 col-md-3">
                            <a href="javascript:;" onclick="dr_show_image('{$item[images][title][$i]}', '{dr_get_file($t)}')" class="thumbnail"><img src="{dr_thumb($t, 200,200)}" > </a>
                        </div>
                        {/loop}
                        </div>
                        </div>
                    </div>
                </div>
                <!--/span-->
            </div>

        </div>
    </div>
    <div class="portlet light ">
        <div class="portlet-title">
            <div class="caption fc-mall-order-title">
                处理结果
            </div>
        </div>
        <div class="portlet-body form" style="padding-top: 20px!important;padding-bottom: 20px!important">

            {if $item.status == 0}
            申请已被关闭
            {elseif $item.status == 1}
            申请已提交，等待商家处理
            {elseif $item.status == 2}

            <div class="form-group">
                <label class="col-md-3 control-label">邮寄地址</label>
                <div class="col-md-7">
                    <div class="form-control-static">{nl2br($item.system.address)}</div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-md-3 control-label">快递名称</label>
                <div class="col-md-5">
                    <input class="form-control" name="data[kdmc]" value="" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-md-3 control-label">快递单号</label>
                <div class="col-md-5">
                       <input class="form-control" name="data[kddh]" value="" type="text">
                </div>
            </div>
            {if $item.type==3}
            <div class="form-group">
                <label class="col-md-3 control-label">寄回地址</label>
                <div class="col-md-7">
                    <textarea class="form-control" name="data[address]" rows="5"></textarea>
                </div>
            </div>
            {/if}
            <div class="form-group">
                <label class="col-md-3 control-label"></label>
                <div class="col-md-7">
                    <button type="button" onclick="dr_ajax_submit('{dr_now_url()}', 'myform', '2000')" class="btn green"> 提交 </button>
                </div>
            </div>

            {elseif $item.status == 3}
            <p>申请处理成功</p>

            {if $item.type == 3}
                <p> 物流：{$delivery.deliver_name} &nbsp;&nbsp;&nbsp;运单号：<a href="{$delivery.deliver_url}" target="_blank">{$item.system.sn}</a> </p>
                <p class="kdinfo">  </p>
                {if $item.system.sn}
                <script>
                    $.get('/index.php?s=mall&c=api&m=kuaidi&sn={$item.system.sn}&code={$delivery.deliver_code}', function (html) {
                        $('.kdinfo').html(html);
                    });
                </script>
                {/if}
            </ul>
            {/if}
            {elseif $item.status == 4}
            <p style="color: red">{$item.sysnote}</p>
            {elseif $item.status == 5}
            <p>快递名称：{$item.myinfo.kdmc}</p>
            <p>快递单号：{$item.myinfo.kddh}</p>
            {/if}

        </div>
    </div>
</form>

<script>
    function dr_show_image(title, url) {
        layer.load(2, {
            shade: [0.3,'#fff'], //0.1透明度的白色背景
            time: 1000
        });
        layer.open({
            type: 1,
            title: title,
            scrollbar: false,
            resize: true,
            maxmin: true, //开启最大化最小化按钮
            shade: 0,
            area: ['70%', '70%'],
            success: function(layero, index){
                layer.closeAll('loading');
            },
            content: '<p style="text-align: center"><img src="'+url+'"></p>'
        });
    }
</script>
{template "mfooter.html"}